package com.erp.purchase.service.impl;

import java.util.List;
import com.erp.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.erp.purchase.mapper.PurPurchaserMapper;
import com.erp.purchase.domain.PurPurchaser;
import com.erp.purchase.service.IPurPurchaserService;

/**
 * 采购员信息：关联采购订单指派Service业务层处理
 *
 * @author hfw
 * @date 2025-09-02
 */
@Service
public class PurPurchaserServiceImpl implements IPurPurchaserService
{
    @Autowired
    private PurPurchaserMapper purPurchaserMapper;

    /**
     * 查询采购员信息：关联采购订单指派
     *
     * @param id 采购员信息：关联采购订单指派主键
     * @return 采购员信息：关联采购订单指派
     */
    @Override
    public PurPurchaser selectPurPurchaserById(Long id)
    {
        return purPurchaserMapper.selectPurPurchaserById(id);
    }

    /**
     * 查询采购员信息：关联采购订单指派列表
     *
     * @param purPurchaser 采购员信息：关联采购订单指派
     * @return 采购员信息：关联采购订单指派
     */
    @Override
    public List<PurPurchaser> selectPurPurchaserList(PurPurchaser purPurchaser)
    {
        return purPurchaserMapper.selectPurPurchaserList(purPurchaser);
    }

    /**
     * 新增采购员信息：关联采购订单指派
     *
     * @param purPurchaser 采购员信息：关联采购订单指派
     * @return 结果
     */
    @Override
    public int insertPurPurchaser(PurPurchaser purPurchaser)
    {
        purPurchaser.setCreateTime(DateUtils.getNowDate());
        return purPurchaserMapper.insertPurPurchaser(purPurchaser);
    }

    /**
     * 修改采购员信息：关联采购订单指派
     *
     * @param purPurchaser 采购员信息：关联采购订单指派
     * @return 结果
     */
    @Override
    public int updatePurPurchaser(PurPurchaser purPurchaser)
    {
        return purPurchaserMapper.updatePurPurchaser(purPurchaser);
    }

    /**
     * 批量删除采购员信息：关联采购订单指派
     *
     * @param ids 需要删除的采购员信息：关联采购订单指派主键
     * @return 结果
     */
    @Override
    public int deletePurPurchaserByIds(Long[] ids)
    {
        return purPurchaserMapper.deletePurPurchaserByIds(ids);
    }

    /**
     * 删除采购员信息：关联采购订单指派信息
     *
     * @param id 采购员信息：关联采购订单指派主键
     * @return 结果
     */
    @Override
    public int deletePurPurchaserById(Long id)
    {
        return purPurchaserMapper.deletePurPurchaserById(id);
    }
}
